using System.Collections.Generic;
using GGEditor.API;

namespace GGEditor.Core.Plugins
{
    public interface IPluginManager : IPluginContext
    {
        /// <summary>
        /// A list of the currently active plugins
        /// </summary>
		IEnumerable<IPlugin> Plugins { get; }

		/// <summary>
		/// The root node of the plugin tree
		/// </summary>
		IPluginNode RootNode { get; }

        /// <summary>
        /// Insert a plugin into the plugin tree
        /// </summary>
        void AddPlugin(IPlugin plugin);

        /// <summary>
        /// Remove a plugin from the plugin tree
        /// </summary>
        void RemovePlugin(IPlugin plugin);

        /// <summary>
        /// Get a node at a certain path. Returns null on failure.
        /// </summary>
        IPluginNode GetNode(string path);

        /// <summary>
        /// Traverse the plugin tree and update each node based on its conditions
        /// </summary>
        void UpdateObjects();

		event PluginManagerEventHandler PluginAdded;

		event PluginManagerEventHandler PluginRemoved;
    }

	public delegate void PluginManagerEventHandler(IPlugin plugin);
}